//
//  CTVSystemFeedback.h
//  Channltv
//
//  Created by Bruno Keymolen on 19/09/07.
//  Copyright 2007 channl.tv. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "CTVClip.h"

@interface CTVSystemFeedback : NSObject {
	NSURLConnection* m_connection;	
}

-(id)init;
-(void)dealloc;


+(void)rateClip:(CTVClip*)clip rate:(int)rate;
+(void)systemFeedBackWithMessage:(NSString*)message;
+(void)systemClipFeedBackWithMessage:(NSString*)message andClipID:(NSString*)clipID;


-(int)asyncPostToURLString:(NSString*)urlString usingForm:(NSString*)formName andFields:(NSDictionary*)dict postXML:(BOOL)postXml;
-(int)asyncGetURLString:(NSString*)urlString;

/* NSURLConnection Delegates */
- (void)connection:(NSURLConnection *)connection didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error;
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse;
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;
- (void)connectionDidFinishLoading:(NSURLConnection *)connection;


@end
